import request from '../../utils/request.js'

// 添加活动
export const addActivity = (data: any) => {
    return request({ url: `/tienchin/activity`, method: "POST", data: data })
}


// 编辑活动
export const editActivity = (data: any) => {
    return request({ url: `/tienchin/activity`, method: "PUT", data: data })
}


// 查询所有渠道列表
export const getAllChannellists = (data: any) => {
    return request({ url: `/tienchin/activity/channel/list`, method: "GET", params: data })
}


// 导出促销活动
export const exportActivity = (activityId: any, beginTime: any, channelId: any, endTime: any, info: any, name: any, type: any) => {
    const data = {
        activityId,
        beginTime,
        channelId,
        endTime,
        info,
        name,
        type
    }
    return request({ url: `/tienchin/activity/export`, method: "POST", data: data })
}


// 按分页查询促销活动列表
export const getPagingActivity = (data: any) => {
    return request({ url: `/tienchin/activity/list`, method: "GET", params: data })
}


// 根据活动id(可多个)删除活动
export const deleteTeam = (activityIds: any, data: any) => {
    return request({ url: `/tienchin/activity/${activityIds}`, method: "DELETE", data: data })
}


// 根据活动ID查询一个具体的活动
export const getActivityItemData = (activityId:any) => {
    return request({url: `/tienchin/activity/${activityId}`, method: "GET"})
}